﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="form-view.aspx.cs" Inherits="Dala.Samples.form_view.form_view" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:FormView ID="fvProduct" runat="server" AllowPaging="True" DataKeyNames="ProductId"
        OnItemDeleting="fvProduct_ItemDeleting" OnItemInserting="fvProduct_ItemInserting"
        OnItemUpdating="fvProduct_ItemUpdating" OnModeChanging="fvProduct_ModeChanging"
        OnPageIndexChanging="fvProduct_PageIndexChanging" Style="margin-top: 20px;">
        <EditItemTemplate>
            ID:
            <asp:Label ID="lblProductID" runat="server" Text='<%# Eval("ProductId") %>' /><br />
            Name:
            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("ProductName") %>' /><br />
            Item Number:
            <asp:TextBox ID="txtItemNumber" runat="server" Text='<%# Bind("ItemNumber") %>' /><br />
            <asp:LinkButton ID="btnUpdate" runat="server" CausesValidation="True" CommandName="Update"
                Text="Update" />
            <asp:LinkButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            Name:
            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("ProductName") %>' /><br />
            Item Number:
            <asp:TextBox ID="txtItemNumber" runat="server" Text='<%# Bind("ItemNumber") %>' /><br />
            <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="True" CommandName="Insert"
                Text="Insert" />
            <asp:LinkButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            ID:
            <asp:Label ID="lblProductID" runat="server" Text='<%# Eval("ProductId") %>' /><br />
            Name:
            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("ProductName") %>' /><br />
            Item Number:
            <asp:TextBox ID="txtItemNumber" runat="server" Text='<%# Bind("ItemNumber") %>' /><br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                Text="Edit" />
            <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                Text="Delete" />
            <asp:LinkButton ID="btnNew" runat="server" CausesValidation="False" CommandName="New"
                Text="New" />
        </ItemTemplate>
    </asp:FormView>
</asp:Content>
